Home Archives About Tags Works
3月 2 2015
Online Judge►UVa

[UVa] 10165 - Stone Game

拈遊戲,此題可利用XOR運算。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
using namespace std;
int main()
{
for ( int n ; cin >> n && n != 0 ; )
{
int sum = 0 ;
for ( int n2 = 0 , input ; n2 < n && cin >> input ; n2 ++ )
sum ^= input ;
if ( sum != 0 )
cout << "Yes" << endl ;
else
cout << "No" << endl ;
}
return 0;
}
Share Comments
  • Math
  • UVa
Newer
[UVa] 100 - The 3n + 1 problem
Older
[UVa] 10887 - Concatenation of Languages

Categories

  • Content Management System1
    • Joomla1
  • Learning Note1
    • Machine Learning1
  • Mobile Application9
    • Android6
    • Cordova3
  • Online Judge47
    • Codewars3
    • Google Code Jam1
    • LeetCode31
    • Pwnable.kr1
    • UVa11
  • Other3
  • Programming Language19
    • C/C++4
    • Java5
    • JavaScript9
    • Python1
  • Security1
  • Server1
    • CentOS1
  • Tool3
    • Compiler1
    • Parser1
      • Bison1
    • Scanner1
      • Flex1
  • Web44
    • Front-End19
    • Hexo3
    • Markdown1
    • Node.js2
    • Other4
    • Overall9
    • PHP3
    • Phoenix1
    • Redux1
    • jQuery1

Recents

  • [LeetCode] 670 - Maximum Swap
  • [LeetCode] 654 - Maximum Binary Tree
  • [LeetCode] 647 - Palindromic Substrings
  • [LeetCode] 560 - Subarray Sum Equals K
  • [LeetCode] 515 - Find Largest Value in Each Tree Row
  • [LeetCode] 513 - Find Bottom Left Tree Value
  • [LeetCode] 508 - Most Frequent Subtree Sum
  • [LeetCode] 451 - Sort Characters By Frequency
  • [LeetCode] 442 - Find All Duplicates in an Array
  • [LeetCode] 287 - Find the Duplicate Number

Links

  • Online Avalon
  • MapleStory Defense
  • Building House
Powered by Hexo and Theme by landscape © Chi-Wei Liu
Home Archives About Tags Works